#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>

//https://leetcode.cn/problems/balanced-binary-tree/

struct TreeNode {
    char val;
    struct TreeNode *left;
    struct TreeNode *right;
};

int maxDepth(struct TreeNode* root){
    if (root == NULL) {
        return 0;
    }
    int numLeft = maxDepth(root->left);
    int numRight = maxDepth(root->right);
    return fmax(numLeft, numRight) + 1;
}

bool isBalanced(struct TreeNode* root){
    if (root == NULL) {
        return true;
    }
    int numLeft = maxDepth(root->left);
    int numRight = maxDepth(root->right);
    return abs(numLeft - numRight) <= 1 && isBalanced(root->left) && isBalanced(root->right);
}

int main() {

    return 0;
}


